#include <unistd.h>
#include <iostream>
#include <signal.h>
using namespace std;

typedef void (*sighandler_t)(int);
void handler(int sigid)
{
    cout << "Catch No." << sigid << endl;
    alarm(5);
}

int main()
{
    signal(14, handler);
    alarm(5);
    while (1)
    {
        cout << "I'm a process.My pid is " << getpid() << endl;
        sleep(1);
    }
    return 0;
}
